package service;

import beans.Plan;
import beans.ResultPlan;
import beans.Task;
import beans.UpdataPlan;
import dao.empDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
@Service
public class employeeServiceImpl implements employeeService {
    @Autowired
    private empDao empDao;

    @Override
    public List<Task> selectTaskByEmpId(Integer id) {
        List<Task> tasks = empDao.selectTasksByEmpId(id);

        return tasks;
    }

    @Override
    public List<Plan> selectPlanByTaskId(Integer id) {
        List<Plan> plans=empDao.selectPlanByTaskId(id);
        return plans;
    }

    @Override
    public Task selectTaskById(Integer id) {

        return empDao.selectTaskById(id);
    }

    @Override
    public void addPlan(Plan plan) {
        empDao.addPlan(plan);
    }

    @Override
    public void deletePlanById(Integer plan_id) {
        empDao.deletePlanById(plan_id);
    }

    @Override
    public Plan selectPlanById(Integer plan_id) {
        return empDao.selectPlanById(plan_id);
    }

    @Override
    public void updatePlanById(UpdataPlan plan) {
        empDao.updatePlanById(plan);
    }

    @Override
    public List<Integer> selectTaskId(Integer id) {
        return empDao.selectTaskId(id);
    }

    @Override
    public List<Integer> selectPlanId(List<Integer> taskIds) {
        return empDao.selectPlanId(taskIds);
    }

    @Override
    public List<Plan> selectPlanByLike(ResultPlan plan) {
        return empDao.selectPlanByLike(plan);
    }
}
